<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.math.Math</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.math.Math");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791">tango.math.Math</a></h1>
                
<font color="black">Elementary Mathematical Functions</font><br><br>
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>, Digital Mars.<br><br>
<b>Authors:</b><br>
Walter Bright, Don Clugston, Sean Kelly<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L84">E</a></span>
<script>explorer.outline.addDecl('E');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">e </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L85">LOG2T</a></span>
<script>explorer.outline.addDecl('LOG2T');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">log<sub>2</sub>10 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L86">LOG2E</a></span>
<script>explorer.outline.addDecl('LOG2E');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">log<sub>2</sub>e </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L87">LOG2</a></span>
<script>explorer.outline.addDecl('LOG2');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">log<sub>10</sub>2 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L88">LOG10E</a></span>
<script>explorer.outline.addDecl('LOG10E');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">log<sub>10</sub>e </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L89">LN2</a></span>
<script>explorer.outline.addDecl('LN2');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">ln 2 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L90">LN10</a></span>
<script>explorer.outline.addDecl('LN10');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">ln 10 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L91">PI</a></span>
<script>explorer.outline.addDecl('PI');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">&pi; </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L92">PI_2</a></span>
<script>explorer.outline.addDecl('PI_2');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">&pi; / 2 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L93">PI_4</a></span>
<script>explorer.outline.addDecl('PI_4');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">&pi; / 4 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L94">M_1_PI</a></span>
<script>explorer.outline.addDecl('M_1_PI');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">1 / &pi; </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L95">M_2_PI</a></span>
<script>explorer.outline.addDecl('M_2_PI');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">2 / &pi; </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L96">M_2_SQRTPI</a></span>
<script>explorer.outline.addDecl('M_2_SQRTPI');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">2 / &radic;&pi; </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L97">SQRT2</a></span>
<script>explorer.outline.addDecl('SQRT2');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">&radic;2 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L98">SQRT1_2</a></span>
<script>explorer.outline.addDecl('SQRT1_2');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">&radic;&frac12 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L103">MAXLOG</a></span>
<script>explorer.outline.addDecl('MAXLOG');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">log&#40;real.max&#41; </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L104">MINLOG</a></span>
<script>explorer.outline.addDecl('MINLOG');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">log&#40;real.min*real.epsilon&#41; </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L105">EULERGAMMA</a></span>
<script>explorer.outline.addDecl('EULERGAMMA');</script>; [const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Euler-Mascheroni constant 0.57721566.. </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L117">abs</a></span>
<script>explorer.outline.addDecl('abs');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>long <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L123">abs</a></span>
<script>explorer.outline.addDecl('abs');</script>(long <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>int <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L129">abs</a></span>
<script>explorer.outline.addDecl('abs');</script>(int <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L135">abs</a></span>
<script>explorer.outline.addDecl('abs');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L141">abs</a></span>
<script>explorer.outline.addDecl('abs');</script>(ireal <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the absolute value</font><br><br>
<font color="black">For complex numbers, abs&#40;z&#41; = sqrt&#40; z.re<sup>2</sup> + z.im<sup>2</sup> &#41;
 = hypot&#40;z.re, z.im&#41;.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L168">conj</a></span>
<script>explorer.outline.addDecl('conj');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>ireal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L174">conj</a></span>
<script>explorer.outline.addDecl('conj');</script>(ireal <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Complex conjugate</font><br><br>
<font color="black">conj&#40;x + iy&#41; = x - iy<br><br> Note that z * conj&#40;z&#41; = z.re<sup>2</sup> + z.im<sup>2</sup>
 is always a real number
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>minmaxtype!(T) <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L203">min</a></span>
<script>explorer.outline.addDecl('min');</script>(T...)(T <span class="funcparam">arg</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the minimum of the supplied arguments.</font><br><br>
<b>Note:</b><br>If the arguments are floating-point numbers, and at least one is a NaN,
 the result is undefined.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>minmaxtype!(T) <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L214">max</a></span>
<script>explorer.outline.addDecl('max');</script>(T...)(T <span class="funcparam">arg</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the maximum of the supplied arguments.</font><br><br>
<b>Note:</b><br>If the arguments are floating-point numbers, and at least one is a NaN,
 the result is undefined.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L238">minNum</a></span>
<script>explorer.outline.addDecl('minNum');</script>(real <span class="funcparam">x</span>, real <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the minimum number of x and y, favouring numbers over NaNs.</font><br><br>
<font color="black">If both x and y are numbers, the minimum is returned.
 If both parameters are NaN, either will be returned.
 If one parameter is a NaN and the other is a number, the number is
 returned &#40;this behaviour is mandated by IEEE 754R, and is useful
 for determining the range of a function&#41;.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L250">maxNum</a></span>
<script>explorer.outline.addDecl('maxNum');</script>(real <span class="funcparam">x</span>, real <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the maximum number of x and y, favouring numbers over NaNs.</font><br><br>
<font color="black">If both x and y are numbers, the maximum is returned.
 If both parameters are NaN, either will be returned.
 If one parameter is a NaN and the other is a number, the number is
 returned &#40;this behaviour is mandated by IEEE 754R, and is useful
 for determining the range of a function&#41;.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L260">minNaN</a></span>
<script>explorer.outline.addDecl('minNaN');</script>(real <span class="funcparam">x</span>, real <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the minimum of x and y, favouring NaNs over numbers</font><br><br>
<font color="black">If both x and y are numbers, the minimum is returned.
 If both parameters are NaN, either will be returned.
 If one parameter is a NaN and the other is a number, the NaN is returned.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L270">maxNaN</a></span>
<script>explorer.outline.addDecl('maxNaN');</script>(real <span class="funcparam">x</span>, real <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the maximum of x and y, favouring NaNs over numbers</font><br><br>
<font color="black">If both x and y are numbers, the maximum is returned.
 If both parameters are NaN, either will be returned.
 If one parameter is a NaN and the other is a number, the NaN is returned.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L301">cos</a></span>
<script>explorer.outline.addDecl('cos');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns cosine of x. x is in radians.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr><th>x</th>               <th>cos(x)</th> <th>invalid?</th>  </tr>
  <tr><td><font color="red">NAN</font></td>          <td><font color="red">NAN</font></td> <td>yes</td>   </tr>
  <tr><td>&plusmn;&infin;</td> <td><font color="red">NAN</font></td> <td>yes</td>   </tr>
  </table>
 </font><br><br>
<font color="red">BUGS:</font><br>
Results are undefined if |x| &gt;= 2<sup>64</sup>.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L336">sin</a></span>
<script>explorer.outline.addDecl('sin');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns sine of x. x is in radians.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x               <th> sin(x)      <th>invalid?
  <tr> <td> <font color="red">NAN</font>          <td> <font color="red">NAN</font>      <td> yes
  <tr> <td> &plusmn;0.0     <td> &plusmn;0.0 <td> no
  <tr> <td> &plusmn;&infin; <td> <font color="red">NAN</font>      <td> yes
  </table>
 </font><br><br>
<font color="red">BUGS:</font><br>
Results are undefined if |x| &gt;= 2<sup>64</sup>.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L373">tan</a></span>
<script>explorer.outline.addDecl('tan');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns tangent of x. x is in radians.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
	<tr><th>x</th>               <th>tan(x)</th>       <th>invalid?</th></tr>
	<tr><td><font color="red">NAN</font></td>          <td><font color="red">NAN</font></td>       <td>yes</td></tr>
	<tr><td>&plusmn;0.0</td>    <td>&plusmn;0.0</td> <td>no</td></tr>
	<tr><td>&plusmn;&infin;</td> <td><font color="red">NAN</font></td>     <td>yes</td></tr>
	</table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L488">cosPi</a></span>
<script>explorer.outline.addDecl('cosPi');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L494">sinPi</a></span>
<script>explorer.outline.addDecl('sinPi');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L500">atanPi</a></span>
<script>explorer.outline.addDecl('atanPi');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Sine, cosine, and arctangent of multiple of &pi;</font><br><br>
<font color="black">Accuracy is preserved for large values of x.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L522">sin</a></span>
<script>explorer.outline.addDecl('sin');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>ireal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L529">sin</a></span>
<script>explorer.outline.addDecl('sin');</script>(ireal <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">sine, complex and imaginary</font><br><br>
<font color="black">sin&#40;z&#41; = sin&#40;z.re&#41;*cosh&#40;z.im&#41; + cos&#40;z.re&#41;*sinh&#40;z.im&#41;i<br><br> If both sin&#40;&theta;&#41; and cos&#40;&theta;&#41; are required,
 it is most efficient to use expi&#40;&theta&#41;.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L546">cos</a></span>
<script>explorer.outline.addDecl('cos');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L553">cos</a></span>
<script>explorer.outline.addDecl('cos');</script>(ireal <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">cosine, complex and imaginary</font><br><br>
<font color="black">cos&#40;z&#41; = cos&#40;z.re&#41;*cosh&#40;z.im&#41; + sin&#40;z.re&#41;*sinh&#40;z.im&#41;i
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L577">acos</a></span>
<script>explorer.outline.addDecl('acos');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the arc cosine of x,
 returning a value ranging from -&pi;/2 to &pi;/2.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
      <tr><th>x</th>         <th>acos(x)</th> <th>invalid?</th></tr>
      <tr><td>&gt;1.0</td>  <td><font color="red">NAN</font></td>  <td>yes</td></tr>
      <tr><td>&lt;-1.0</td> <td><font color="red">NAN</font></td>  <td>yes</td></tr>
      <tr><td><font color="red">NAN</font></td>    <td><font color="red">NAN</font></td>  <td>yes</td></tr>
      </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L600">asin</a></span>
<script>explorer.outline.addDecl('asin');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the arc sine of x,
 returning a value ranging from -&pi;/2 to &pi;/2.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
	<tr><th>x</th>            <th>asin(x)</th>      <th>invalid?</th></tr>
	<tr><td>&plusmn;0.0</td> <td>&plusmn;0.0</td> <td>no</td></tr>
	<tr><td>&gt;1.0</td>     <td><font color="red">NAN</font></td>       <td>yes</td></tr>
	<tr><td>&lt;-1.0</td>    <td><font color="red">NAN</font></td>       <td>yes</td></tr>
       </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L622">atan</a></span>
<script>explorer.outline.addDecl('atan');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the arc tangent of x,
 returning a value ranging from -&pi;/2 to &pi;/2.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
	<tr><th>x</th>                 <th>atan(x)</th>      <th>invalid?</th></tr>
	<tr><td>&plusmn;0.0</td>      <td>&plusmn;0.0</td> <td>no</td></tr>
	<tr><td>&plusmn;&infin;</td> <td><font color="red">NAN</font></td>       <td>yes</td></tr>
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L659">atan2</a></span>
<script>explorer.outline.addDecl('atan2');</script>(real <span class="funcparam">y</span>, real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the arc tangent of y / x,
 returning a value ranging from -&pi;/2 to &pi;/2.</font><br><br>
<b>Remarks:</b><br>The Complex Argument of a complex number z is given by
  Arg&#40;z&#41; = atan2&#40;z.re, z.im&#41;<br><br>  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> y           <th> x         <th> atan(y, x)
  <tr> <td> <font color="red">NAN</font>      <td> anything  <td> <font color="red">NAN</font>
  <tr> <td> anything    <td> <font color="red">NAN</font>    <td> <font color="red">NAN</font>
  <tr> <td> &plusmn;0.0       <td> &gt; 0.0  <td> &plusmn;0.0
  <tr> <td> &plusmn;0.0       <td> &plusmn;0.0     <td> &plusmn;0.0
  <tr> <td> &plusmn;0.0       <td> &lt; 0.0  <td> &plusmn;&pi;
  <tr> <td> &plusmn;0.0       <td> -0.0      <td> &plusmn;&pi;
  <tr> <td> &gt; 0.0    <td> &plusmn;0.0     <td> &pi;/2
  <tr> <td> &lt; 0.0    <td> &plusmn;0.0     <td> &pi;/2
  <tr> <td> &gt; 0.0    <td> &infin;  <td> &plusmn;0.0
  <tr> <td> &plusmn;&infin;  <td> anything  <td> &plusmn;&pi;/2
  <tr> <td> &gt; 0.0    <td> -&infin; <td> &plusmn;&pi;
  <tr> <td> &plusmn;&infin;  <td> &infin;  <td> &plusmn;&pi;/4
  <tr> <td> &plusmn;&infin;  <td> -&infin; <td> &plusmn;3&pi;/4
      </table><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L678">asin</a></span>
<script>explorer.outline.addDecl('asin');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Complex inverse sine</font><br><br>
<font color="black">asin&#40;z&#41; = -i log&#40; sqrt&#40;1-z<sup>2</sup>&#41; + iz&#41;
 where both log and sqrt are complex.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L694">acos</a></span>
<script>explorer.outline.addDecl('acos');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Complex inverse cosine</font><br><br>
<font color="black">acos&#40;z&#41; = &pi/2 - asin&#40;z&#41;
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L708">cosh</a></span>
<script>explorer.outline.addDecl('cosh');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the hyperbolic cosine of x.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x                <th> cosh(x)     <th> invalid?
  <tr> <td> &plusmn;&infin;  <td> &plusmn;0.0 <td> no
      </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L729">sinh</a></span>
<script>explorer.outline.addDecl('sinh');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the hyperbolic sine of x.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x               <th> sinh(x)         <th> invalid?
  <tr> <td> &plusmn;0.0     <td> &plusmn;0.0     <td> no
  <tr> <td> &plusmn;&infin; <td> &plusmn;&infin; <td> no
      </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L750">tanh</a></span>
<script>explorer.outline.addDecl('tanh');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the hyperbolic tangent of x.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x               <th> tanh(x)      <th> invalid?
  <tr> <td> &plusmn;0.0     <td> &plusmn;0.0  <td> no
  <tr> <td> &plusmn;&infin; <td> &plusmn;1.0  <td> no
      </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L767">sinh</a></span>
<script>explorer.outline.addDecl('sinh');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>ireal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L774">sinh</a></span>
<script>explorer.outline.addDecl('sinh');</script>(ireal <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">hyperbolic sine, complex and imaginary</font><br><br>
<font color="black">sinh&#40;z&#41; = cos&#40;z.im&#41;*sinh&#40;z.re&#41; + sin&#40;z.im&#41;*cosh&#40;z.re&#41;i
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L790">cosh</a></span>
<script>explorer.outline.addDecl('cosh');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L797">cosh</a></span>
<script>explorer.outline.addDecl('cosh');</script>(ireal <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">hyperbolic cosine, complex and imaginary</font><br><br>
<font color="black">cosh&#40;z&#41; = cos&#40;z.im&#41;*cosh&#40;z.re&#41; + sin&#40;z.im&#41;*sinh&#40;z.re&#41;i
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L826">acosh</a></span>
<script>explorer.outline.addDecl('acosh');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the inverse hyperbolic cosine of x.</font><br><br>
<font color="black">Mathematically, acosh&#40;x&#41; = log&#40;x + sqrt&#40; x*x - 1&#41;&#41;<br><br> <table border=1 cellpadding=4 cellspacing=0>
  <tr><td>Domain</td> <td>1..&infin;</td></tr>
  <tr><td>Range</td> <td>1..log(real.max), &infin; </td></tr>
 </table>
  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
    <tr><th>x</th> <th>acosh(x) </th></tr>
    <tr><td><font color="red">NAN</font></td> <td><font color="red">NAN</font> </td></tr>
    <tr><td><1</td> <td><font color="red">NAN</font> </td></tr>
    <tr><td>1</td> <td>0       </td></tr>
    <tr><td>+&infin;</td> <td>+&infin;</td></tr>
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L862">asinh</a></span>
<script>explorer.outline.addDecl('asinh');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the inverse hyperbolic sine of x.</font><br><br>
<font color="black">Mathematically,
  <pre class="d_code">

  <span class="i">asinh</span>(<span class="i">x</span>) =  <span class="i">log</span>( <span class="i">x</span> + <span class="i">sqrt</span>( <span class="i">x</span>*<span class="i">x</span> + <span class="n">1</span> )) <span class="lc">// if x &gt;= +0</span>
  <span class="i">asinh</span>(<span class="i">x</span>) = -<span class="i">log</span>(-<span class="i">x</span> + <span class="i">sqrt</span>( <span class="i">x</span>*<span class="i">x</span> + <span class="n">1</span> )) <span class="lc">// if x &lt;= -0</span>
  
</pre><br><br>  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
    <tr><th>x</th> <th>asinh(x)       </th></tr>
    <tr><td><font color="red">NAN</font></td> <td><font color="red">NAN</font>         </td></tr>
    <tr><td>&plusmn;0</td> <td>&plusmn;0      </td></tr>
    <tr><td>&plusmn;&infin;</td> <td>&plusmn;&infin;</td></tr>
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L903">atanh</a></span>
<script>explorer.outline.addDecl('atanh');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L923">atanh</a></span>
<script>explorer.outline.addDecl('atanh');</script>(ireal <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L930">atanh</a></span>
<script>explorer.outline.addDecl('atanh');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the inverse hyperbolic tangent of x,
 returning a value from ranging from -1 to 1.</font><br><br>
<font color="black">Mathematically, atanh&#40;x&#41; = log&#40; &#40;1+x&#41;/&#40;1-x&#41; &#41; / 2<br><br>
 <table border=1 cellpadding=4 cellspacing=0>
  <tr><td>Domain</td> <td>-&infin;..&infin;</td></tr>
  <tr><td>Range</td> <td>-1..1</td></tr> </table>
  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
    <tr><th>x</th> <th>atanh(x) </th></tr>
    <tr><td><font color="red">NAN</font></td> <td><font color="red">NAN</font> </td></tr>
    <tr><td>&plusmn;0</td> <td>&plusmn;0</td></tr>
    <tr><td>&plusmn;1</td> <td>&plusmn;&infin;</td></tr>
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>float <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L950">sqrt</a></span>
<script>explorer.outline.addDecl('sqrt');</script>(float <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L999">sqrt</a></span>
<script>explorer.outline.addDecl('sqrt');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Compute square root of x.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x        <th> sqrt(x)  <th> invalid?
  <tr> <td> -0.0     <td> -0.0     <td> no
  <tr> <td> &lt;0.0  <td> <font color="red">NAN</font>   <td> yes
  <tr> <td> +&infin; <td> +&infin; <td> no
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1046">cbrt</a></span>
<script>explorer.outline.addDecl('cbrt');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the cube root of x.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> <i>x</i>  <th> cbrt(x)    <th> invalid?
  <tr> <td> &plusmn;0.0   <td> &plusmn;0.0    <td> no
  <tr> <td> <font color="red">NAN</font>    <td> <font color="red">NAN</font>     <td> yes
  <tr> <td> &plusmn;&infin;   <td> &plusmn;&infin; <td> no
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1068">exp</a></span>
<script>explorer.outline.addDecl('exp');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates e<span style="vertical-align:super;font-size:smaller">x</span>.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x        <th> exp(x)
  <tr> <td> +&infin; <td> +&infin;
  <tr> <td> -&infin; <td> +0.0
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1094">expm1</a></span>
<script>explorer.outline.addDecl('expm1');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the value of the natural logarithm base &#40;e&#41;
 raised to the power of x, minus 1.</font><br><br>
<font color="black">For very small x, expm1&#40;x&#41; is more accurate
 than exp&#40;x&#41;-1.<br><br>  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> e<span style="vertical-align:super;font-size:smaller">x</span>-1
  <tr> <td> &plusmn;0.0 <td> &plusmn;0.0
  <tr> <td> +&infin;    <td> +&infin;
  <tr> <td> -&infin;    <td> -1.0
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1116">exp2</a></span>
<script>explorer.outline.addDecl('exp2');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates 2<span style="vertical-align:super;font-size:smaller">x</span>.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x <th> exp2(x)
  <tr> <td> +&infin; <td> +&infin;
  <tr> <td> -&infin; <td> +0.0
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1142">log</a></span>
<script>explorer.outline.addDecl('log');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculate the natural logarithm of x.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> log(x)   <th> divide by 0? <th> invalid?
  <tr> <td> &plusmn;0.0 <td> -&infin; <td> yes          <td> no
  <tr> <td> &lt; 0.0    <td> <font color="red">NAN</font>   <td> no           <td> yes
  <tr> <td> +&infin;    <td> +&infin; <td> no           <td> no
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1168">log1p</a></span>
<script>explorer.outline.addDecl('log1p');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the natural logarithm of 1 + x.</font><br><br>
<font color="black">For very small x, log1p&#40;x&#41; will be more accurate than
  log&#40;1 + x&#41;.<br><br>  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> log1p(x)    <th> divide by 0? <th> invalid?
  <tr> <td> &plusmn;0.0 <td> &plusmn;0.0 <td> no           <td> no
  <tr> <td> -1.0        <td> -&infin;    <td> yes          <td> no
  <tr> <td> &lt;-1.0    <td> <font color="red">NAN</font>      <td> no           <td> yes
  <tr> <td> +&infin;    <td> -&infin;    <td> no           <td> no
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1191">log2</a></span>
<script>explorer.outline.addDecl('log2');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the base-2 logarithm of x:
 log<sub>2</sub>x</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> log2(x)  <th> divide by 0? <th> invalid?
  <tr> <td> &plusmn;0.0 <td> -&infin; <td> yes          <td> no
  <tr> <td> &lt; 0.0    <td> <font color="red">NAN</font>   <td> no           <td> yes
  <tr> <td> +&infin;    <td> +&infin; <td> no           <td> no
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1213">log10</a></span>
<script>explorer.outline.addDecl('log10');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculate the base-10 logarithm of x.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x           <th> log10(x) <th> divide by 0? <th> invalid?
  <tr> <td> &plusmn;0.0 <td> -&infin; <td> yes          <td> no
  <tr> <td> &lt; 0.0    <td> <font color="red">NAN</font>   <td> no           <td> yes
  <tr> <td> +&infin;    <td> +&infin; <td> no           <td> no
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1236">exp</a></span>
<script>explorer.outline.addDecl('exp');</script>(ireal <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1242">exp</a></span>
<script>explorer.outline.addDecl('exp');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Exponential, complex and imaginary</font><br><br>
<font color="black">For complex numbers, the exponential function is defined as<br><br>  exp&#40;z&#41; = exp&#40;z.re&#41;cos&#40;z.im&#41; + exp&#40;z.re&#41;sin&#40;z.im&#41;i.<br><br>  For a pure imaginary argument,
  exp&#40;&theta;i&#41;  = cos&#40;&theta;&#41; + sin&#40;&theta;&#41;i.<br><br> </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>creal <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1277">log</a></span>
<script>explorer.outline.addDecl('log');</script>(creal <span class="funcparam">z</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Natural logarithm, complex</font><br><br>
<font color="black">Returns complex logarithm to the base e &#40;2.718...&#41; of
 the complex argument x.<br><br> If z = x + iy, then
       log&#40;z&#41; = log&#40;abs&#40;z&#41;&#41; + i arctan&#40;y/x&#41;.<br><br> The arctangent ranges from -PI to +PI.
 There are branch cuts along both the negative real and negative
 imaginary axes. For pure imaginary arguments, use one of the
 following forms, depending on which branch is required.
 <pre class="d_code">

    <span class="i">log</span>( <span class="n">0.0</span> + <span class="i">yi</span>) = <span class="i">log</span>(-<span class="i">y</span>) + <span class="i">PI_2i</span>  <span class="lc">// y&lt;=-0.0</span>
    <span class="i">log</span>(-<span class="n">0.0</span> + <span class="i">yi</span>) = <span class="i">log</span>(-<span class="i">y</span>) - <span class="i">PI_2i</span>  <span class="lc">// y&lt;=-0.0</span>
 
</pre>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1305">pow</a></span>
<script>explorer.outline.addDecl('pow');</script>(real <span class="funcparam">x</span>, uint <span class="funcparam">n</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1339">pow</a></span>
<script>explorer.outline.addDecl('pow');</script>(real <span class="funcparam">x</span>, int <span class="funcparam">n</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Fast integral powers.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1387">pow</a></span>
<script>explorer.outline.addDecl('pow');</script>(real <span class="funcparam">x</span>, real <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates x<span style="vertical-align:super;font-size:smaller">y</span>.</font><br><br>
<font color="black"><table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
 <tr>
 <th> x <th> y <th> pow(x, y) <th> div 0 <th> invalid?
 <tr>
 <td> anything    <td> &plusmn;0.0    <td> 1.0    <td> no     <td> no
 <tr>
 <td> |x| &gt; 1  <td> +&infin;       <td> +&infin;   <td> no     <td> no
 <tr>
 <td> |x| &lt; 1  <td> +&infin;       <td> +0.0   <td> no     <td> no
 <tr>
 <td> |x| &gt; 1  <td> -&infin;       <td> +0.0   <td> no     <td> no
 <tr>
 <td> |x| &lt; 1  <td> -&infin;       <td> +&infin;   <td> no     <td> no
 <tr>
 <td> +&infin;    <td> &gt; 0.0       <td> +&infin;   <td> no     <td> no
 <tr>
 <td> +&infin;    <td> &lt; 0.0       <td> +0.0   <td> no     <td> no
 <tr>
 <td> -&infin;    <td> odd integer &gt; 0.0   <td> -&infin;   <td> no     <td> no
 <tr>
 <td> -&infin;    <td> &gt; 0.0, not odd integer  <td> +&infin;   <td> no     <td> no
 <tr>
 <td> -&infin;    <td> odd integer &lt; 0.0   <td> -0.0   <td> no     <td> no
 <tr>
 <td> -&infin;    <td> &lt; 0.0, not odd integer  <td> +0.0   <td> no     <td> no
 <tr>
 <td> &plusmn;1.0     <td> &plusmn;&infin;        <td> <font color="red">NAN</font>     <td> no     <td> yes
 <tr>
 <td> &lt; 0.0    <td> finite, nonintegral    <td> <font color="red">NAN</font>     <td> no     <td> yes
 <tr>
 <td> &plusmn;0.0     <td> odd integer &lt; 0.0   <td> &plusmn;&infin; <td> yes   <td> no
 <tr>
 <td> &plusmn;0.0     <td> &lt; 0.0, not odd integer  <td> +&infin;   <td> yes    <td> no
 <tr>
 <td> &plusmn;0.0     <td> odd integer &gt; 0.0   <td> &plusmn;0.0 <td> no    <td> no
 <tr>
 <td> &plusmn;0.0     <td> &gt; 0.0, not odd integer  <td> +0.0   <td> no     <td> no
 </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1516">hypot</a></span>
<script>explorer.outline.addDecl('hypot');</script>(real <span class="funcparam">x</span>, real <span class="funcparam">y</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Calculates the length of the
 hypotenuse of a right-angled triangle with sides of length x and y.
 The hypotenuse is the value of the square root of
 the sums of the squares of x and y:</font><br><br>
<font color="black">sqrt&#40;x&sup2; + y&sup2;&#41;<br><br> Note that hypot&#40;x, y&#41;, hypot&#40;y, x&#41; and
 hypot&#40;x, -y&#41; are equivalent.<br><br>  <table border=1 cellpadding=4 cellspacing=0>
      <caption>Special Values</caption>
      
  <tr> <th> x               <th> y           <th> hypot(x, y) <th> invalid?
  <tr> <td> x               <td> &plusmn;0.0 <td> |x|         <td> no
  <tr> <td> &plusmn;&infin; <td> y           <td> +&infin;    <td> no
  <tr> <td> &plusmn;&infin; <td> <font color="red">NAN</font>      <td> +&infin;    <td> no
  </table>
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>T <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1623">poly</a></span>
<script>explorer.outline.addDecl('poly');</script>(T)(T <span class="funcparam">x</span>, T[] <span class="funcparam">A</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Evaluate polynomial A&#40;x&#41; = a<sub>0</sub> + a<sub>1</sub>x + a<sub>2</sub>x&sup2; + a<sub>3</sub>x&sup3; ...</font><br><br>
<font color="black">Uses Horner's rule A&#40;x&#41; = a<sub>0</sub> + x&#40;a<sub>1</sub> + x&#40;a<sub>2</sub> + x&#40;a<sub>3</sub> + ...&#41;&#41;&#41;
 </font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">A</span></td><td>array of coefficients a<sub>0</sub>, a<sub>1</sub>, etc.</td></tr></table><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1728">feq</a></span>
<script>explorer.outline.addDecl('feq');</script>(int precision = MANTDIG_2, XReal=real, YReal=real)(XReal <span class="funcparam">x</span>, YReal <span class="funcparam">y</span>); [deprecated]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Floating point "approximate equality".</font><br><br>
<font color="black">Return true if x is equal to y, to within the specified precision
 If roundoffbits is not specified, a reasonable default is used.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1749">floor</a></span>
<script>explorer.outline.addDecl('floor');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the value of x rounded downward to the next integer
 &#40;toward negative infinity&#41;.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1764">ceil</a></span>
<script>explorer.outline.addDecl('ceil');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the value of x rounded upward to the next integer
 &#40;toward positive infinity&#41;.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1778">round</a></span>
<script>explorer.outline.addDecl('round');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the value of x rounded to the nearest integer.
 If the fractional part of x is exactly 0.5, the return value is rounded to
 the even integer.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1794">trunc</a></span>
<script>explorer.outline.addDecl('trunc');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the integer portion of x, dropping the fractional portion.</font><br><br>
<font color="black">This is also known as "chop" rounding.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>int <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1814">rndint</a></span>
<script>explorer.outline.addDecl('rndint');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>long <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/Math.d?rev=3791#L1833">rndlong</a></span>
<script>explorer.outline.addDecl('rndlong');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Rounds x to the nearest int or long.</font><br><br>
<font color="black">This is generally the fastest method to convert a floating-point number
 to an integer. Note that the results from this function
 depend on the rounding mode, if the fractional part of x is exactly 0.5.
 If using the default rounding mode &#40;ties round to even integers&#41;
 rndint&#40;4.5&#41; == 4, rndint&#40;5.5&#41;==6.
</font><br><br></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Portions Copyright (C) 2001-2005 Digital Mars. :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sat Aug  2 16:08:34 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>